/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package chameleon.model;

import chameleon.model.NuGatManager.NuGatManager;
import chameleon.view.input.Input;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 * This class create an instance of a concreteManager. In function of the tool 
 * name given on input, this class creates the corresponding manager.
 *
 *
 * @author simon
 */
public class ManagerFactory {

    public static AbstractManager createManager(Input input) {
        if (input.getToolName() == chameleon.view.Tag.NUGAT)
            return new NuGatManager(input);
        else{
            try {
                throw new IOException("Unsupported tool");
            } catch (IOException ex) {
                Logger.getLogger(ManagerFactory.class.getName()).log(Level.SEVERE, null, ex);
            }
            return null;
        }
    }

}
